package com.contain2.abstractcontain.demo1;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class Test {

	static Map<String, String> map = new FlyweightMap();
	static List<String> names = new ArrayList<String>(map.keySet());

	static Map<String, String> select(final int size) {
		return new FlyweightMap() {
			public Set<Map.Entry<String, String>> entrySet() {
				return new EntrySet(size);
			}
		};
	}

	public static Map<String, String> capitals(int size) {
		return select(size);
	}

	public static List<String> names() {
		return names;
	}

	public static List<String> names(int size) {
		return new ArrayList<String>(select(size).keySet());
	}

	public static void main(String[] args) {
		Map map = capitals(10);
		System.out.println(map);
		System.out.println(map.get("BENIN"));
		System.out.println(names(10));
	}

}
